import java.util.Scanner;

public class HomeWork07_06{
    static void gcdNLcm(int a, int b){
        int multi = a * b;
        while(b != 0){
            int m = a % b;
            a = b;
            b = m;
        }
        System.out.println("最大公约数为：" + a);
        System.out.println("最小公倍数为：" + multi / a);
    }
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        System.out.print("please enter 2 integer: ");
        int a = scan.nextInt();
        int b = scan.nextInt();
        
        gcdNLcm(a, b);
    }
}